<div class="yunBei" style="display: none;"></div>
<div class="popup" style="margin-top: -259.5px;display:none;">
	<h3>添加权限</h3>
	<form id='ct_fm2' action="/Emp/ci_rule_save" method="POST">
	<input name="rule_id" value="" type="hidden" />
	<ul>
		<li class="clearfix">
			<span>*标识(字母)</span>
			<input type="text" name="name" value=""></li>
		<li class="clearfix">
			<span>*权限标题</span>
			<input type="text" value="" name="title"></li>
		
		<input type='hidden' id='pid' name="pid" value="" />
		<li class="popup-btn clearfix">
			<span>父权限ID</span>
			<input type="text" value="" readonly="">
			<ul class="popup-list" style="display: none;">
				<?php foreach ($rule_list as $key => $value): 
					if($value['pid']=='0'){
				?>
					<li onclick="$('#pid').val('<?php echo $value['id'];?>');popup(this);" ><?php echo $value['title'] ?></li>	
				<?php
				}
				 endforeach ?>
			</ul>
		</li>




		

		<li class="clearfix">
			<input type="button" value="确定" class="queding">
			<input type="button" value="取消" class="quxiao"></li>
	</ul>
	</form>
</div>
<script>
	function create_emp(){
		var bg = $('.yunBei'),pp = $('.popup'),cfm=$('.queding'),cl=$('.quxiao');
		bg.show();
		pp.show();
		$([bg,cfm,cl]).each(function(i,n){
			$(n).unbind('click');
		});
		bg.click(hide_pp);	
		cl.click(hide_pp);
		cfm.click(function(){
			post_submit_json('ct_fm2',function(data){
				//成功回调
				delay_alert('添加权限成功',300);
				setTimeout(function(){
					window.location.reload();	
				},300);
			});
		});
		function hide_pp(){
			bg.hide();
			pp.hide();
			bg.unbind('click');
		};
	};	
</script>